/*
 * All rights Reserved, Designed By www.goldbeacon.cn
 * @Title:  demo-springboot
 * @Package com.chenzhengrong.demospringboot.queue
 * @author: chenzhengrong
 * @date:   2022/8/19 11:26
 * @version V1.0
 * Copyright © 2022 www.goldbeacon.cn. All Rights Reserved.
 * 注意：本内容仅限于湖南金烽信息科技有限公司内部传阅，禁止外泄以及用于其他的商业目
 */
package com.chenzhengrong.demospringboot.queue;

import com.chenzhengrong.demospringboot.domain.dto.OperateLogDTO;
import org.springframework.stereotype.Component;

import java.util.concurrent.LinkedBlockingQueue;

/**
 * @author chenzhengrong
 * @title: OperateQueue
 * @description: OperateQueue
 * @date 2022/8/19 11:26
 */
@Component
public class OperateQueue {

    LinkedBlockingQueue<OperateLogDTO> blockingQueue = new LinkedBlockingQueue<>();

    public OperateLogDTO poll() {
        OperateLogDTO poll1 = blockingQueue.poll();
        return poll1;
    }

    public void add(OperateLogDTO operateLogDTO) {
        blockingQueue.add(operateLogDTO);
    }

}
